package ru.voronoy.thefifteen.listeners;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import ru.voronoy.thefifteen.entity.Bone;
import ru.voronoy.thefifteen.gameplay.Game;
import ru.voronoy.thefifteen.gui.MainWindow;

public class BonesMouseListener implements MouseListener {
	private Bone bone;

	public BonesMouseListener(Bone bone) {
		this.bone = bone;
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		Game.getInstance().MoveClickedBone(MainWindow.getBones(), this.bone);
		if (Game.getInstance().isStarted()) {
			if (Game.getInstance().IsOver(MainWindow.getBones())) {
				Game.getInstance().Stop();
			}
		}
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

}
